<admintpl file="header" />
<style>
	*{margin:0; padding:0;}
	body{font-family: "Microsoft Yahei", "hiragino sans gb", Helvetica, Arial, Tahoma;}
	.shdo{position: fixed; left:0; top:0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10; display: none;}
	.stan-box{padding:10px 20px; width: 400px; max-height: 500px; background: #fff; position: fixed; left:100px; top:100px; z-index: 11; display: none;}
	.simgBox{max-height: 440px; overflow: auto; text-align: center;}
	.simgBox img{}
	.stit{height: 30px;}
	.stit .yuan{font-size: 14px;}
	.stit .cuo{display: block; width: 20px; height: 20px; color: #fff; background: #007aff; line-height: 20px; text-align: center; position: absolute; right:0; top:0; cursor: pointer;}
	.sbot{height: 30px; }
	.sbot span{height: 26px; line-height: 26px; width: 50px; font-size: 12px; color: #fff;  background: #007aff;  float: right; text-align: center; border-radius: 2px;margin-top: 6px; cursor: pointer;}
	.tanimg{cursor:pointer;}
    .aBtnInput{display: inline-block; padding:0 2px; background: #f1f1f1; border:1px solid #a5a5a5; border-radius: 2px; }
    .aBtnInput:link,.aBtnInput:visited,.aBtnInput:hover,.aBtnInput:active{text-decoration: none;color: #333;}
</style>
<style>
	*{margin:0; padding:0;}
	body{font-family: "Microsoft Yahei", "hiragino sans gb", Helvetica, Arial, Tahoma;}
	.c-tan-shadow{position: fixed; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,0.3); display:none;}
	.c-tan-box{width:auto; padding:20px 40px 30px; height:auto; background: #fff;position: fixed; left:50%;  top:50%; margin-top:-120px; margin-left:-274px; display:none;}
	.c-tan-box table{border-collapse: collapse; width: 400px;}
	.c-tan-box table td{border:1px solid #000; text-align: center; padding:8px 10px;}
	.c-tan-title{text-align: center; position: relative; height:30px; line-height: 30px; padding-bottom:20px; font-size: 16px;}
	.c-tan-title .c-tan-xiao{ position: absolute; right:0; top:0; width:50px; height:30px; line-height: 30px; cursor: pointer; font-size: 12px;}
	.c-tan-title .c-tan-xiao:hover{ color: #f0080b;}
	.c-tan-center{max-height:220px; width: 420px; overflow:auto;}
	.c-pages{padding:20px 0; text-align: center;}
	.c-pages.tl{text-align: left;}
	.c-pages span{display: inline-block; margin-right: 5px; font-size:12px; height:28px; line-height: 28px;}
	.c-pages span.col{color: #fe344e; font-weight: 600;}
	.c-pages span a{display: inline-block; margin:0 3px; height:28px; line-height: 28px; text-align: center; padding:0 12px; border:1px solid #ccc; text-decoration: none; border-radius: 2px;}
	.c-pages span a:link,.c-pages span a:active,.c-pages span a:visited{color: #333;}
	.c-pages span a:hover{ color: #ff8540; }
	.c-pages span a.active{color: #fff; background: #ff8540;}
	.c-pages  .current{ color: #fff; background: #ff8540; display: inline-block; margin: 0 3px; height: 28px;
		line-height: 28px;
		text-align: center;
		padding: 0 12px;
		text-decoration: none;
		border-radius: 2px;
	}

</style>
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li class="active"><a>财务入款</a></li>
	</ul>
	<form class="well form-search" method="post" action="{:U('Order/caiwu')}">
		会员账号：
		<input type="text" name="accounts" style="width: 220px;" value="{$accounts}" placeholder="请输入会员账号">
		<input type="submit" class="btn btn-primary" value="搜索" />
		<a class="btn btn-danger" href="{:U('Order/caiwu')}">清空</a>
	</form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th style="text-align: center">账号</th>
					<th style="text-align: center">添加金额(+)</th>
					<th style="text-align: center">扣除金额(-)</th>
					<th style="text-align: center">余额</th>
				</tr>
			</thead>
			<tbody>
			<div id="lstt">
				<foreach name="arr" item="v">
					<tr>
						<td style="text-align: center">{$v.accounts}</td>
						<td style="text-align: center"><input name="tianjia"  id="tianjia" style="width: 80px"><input type="button" data-id="{$v.userid}" class="btn  btn-primary tianjia"  value="保存"  style="margin-left: 20px;"></td>
						<td style="text-align: center"><input name="kouchu" id="kouchu" style="width: 80px"><input type="button" data-id="{$v.userid}" class="btn  btn-primary kouchu"  value="保存" style="margin-left: 20px;"></td>
						<td style="text-align: center">{$v.money}</td>
					</tr>
				</foreach>
			</div>
			<div id="lst"></div>

			</tbody>

		</table>
	<div class="c-pages tc">
		<span>{$page}第{$p}页/共{$totalpage}页</span>
	</div>
</div>

</body>
</html>
<script src="__PUBLIC__/js/common.js"></script>
<script>

	$(".tianjia").click(function(){
		var userid = $(this).data("id");
		var tianjia = $(this).siblings("input[name='tianjia']").val();
		if(tianjia==""){
			alert("添加的金额不能为空");
			return false;
		}
		$.ajax({
			type: "POST",
			url: "{:U('Order/tianjia_yue')}",
			data: {'userid': userid,'tianjia': tianjia},
			success: function (dat) {
				if(dat==1){
					alert("添加成功");
					window.location.href="";
				}
			}
		});
	})

	$(".kouchu").click(function(){
		var userid = $(this).data("id");
		var kouchu = $(this).siblings("input[name='kouchu']").val();
		if(kouchu==""){
			alert("扣除的金额不能为空");
			return false;
		}
		$.ajax({
			type: "POST",
			url: "{:U('Order/kouchu_yue')}",
			data: {'userid': userid,'kouchu': kouchu},
			success: function (dat) {
				if(dat==1){
					alert("扣除成功");
					window.location.href="";
				}
			}
		});
	})



</script>